//导入requset工具
import request from '@/utils/request'
// import { useTokenStore } from '@/stores/token.js'
//提供文章分类列表查询的接口
export const articleCategoryListService = () => {
  // const tokenStore = useTokenStore()
  // console.log(tokenStore.token);

  // return request.get('/category', { headers: { 'Authorization': tokenStore.token } })
  return request.get('/category')
}
//添加文章分类
export const addArticleCategoryService = (categoryData) => {
  return request.post('/category', categoryData)
}
//更新文章分类
export const updateArticleCategoryService = (categoryData) => {
  return request.put('/category', categoryData)
}
//删除文章分类
export const deleteArticleCategoryService = (categoryId) => {
  return request.delete('/category?id=' + categoryId)
}
//查询文章列表
export const articleListService = (params) => {
  return request.get('/article', { params: params })
}
//添加文章
export const addArticleService = (articleData) => {
  return request.post('/article', articleData)
}
//更新文章
export const updateArticleService = (articleData) => {
  return request.put('/article', articleData)
}

export const articleDeleteService = () => {
  return request.put('/article?id=' + id)
}